package com.quan.sdk.weixin.utils;

/**
 * 保存微信接口调用凭证到上下文
 * 
 * @author yhaoquan
 *
 */
public class WeixinContext {

	private static String appId;

	private static String appSecret;

	private static String token;

	/**
	 * 公众号的全局唯一接口调用凭据
	 */
	private static String access_token;

	/**
	 * JsApiTickect票据
	 */
	private static String jsapi_ticket;
	
	public static void setAppId(String appId) {
		WeixinContext.appId = appId;
	}
	public static String getAppId() {
		return WeixinContext.appId;
	}
	
	public static void setAppSecret(String appSecret) {
		WeixinContext.appSecret = appSecret;
	}
	public static String getAppSecret() {
		return WeixinContext.appSecret;
	}
	
	public static void setToken(String token) {
		WeixinContext.token = token;
	}
	public static String getToken() {
		return WeixinContext.token;
	}

	/**
	 * 保存调用接口凭证 AccessToken 到上下文
	 * 
	 * @param access_token
	 */
	public static void setAccessToken(String access_token) {
		WeixinContext.access_token = access_token;
	}

	/**
	 * 调用接口凭证 AccessToken
	 * 
	 * @return
	 */
	public static String getAccessToken() {
		return WeixinContext.access_token;
	}

	/**
	 * 保存 JsApiTickect 到上下文
	 * 
	 * @param jsapi_tickect
	 */
	public static void setJsApiTicket(String jsapi_tickect) {
		WeixinContext.jsapi_ticket = jsapi_tickect;
	}

	/**
	 * 获取 JsApiTickect
	 * 
	 * @return
	 */
	public static String getJsApiTicket() {
		return WeixinContext.jsapi_ticket;
	}

}
